#include "lives.h"
#include "config.h"
Lives::Lives()
{
    m_lifepicture.load(LIFE_PATH);
    m_lives=TOTALLIVES;
}

void Lives::decreaseLife()
{
    if(m_lives>0)
    {
        m_lives--;
    }
}

int Lives::leftLives() const
{
    return m_lives;
}

void Lives::draw(QPainter &painter) const
{
    int m_lifeWidth=m_lifepicture.width();
    int x=10;
    int y=50;
    for(int i=0;i<m_lives;i++)
    {
        painter.drawPixmap(x+i*(m_lifeWidth+5),y,m_lifepicture);
    }
}

